A device-to-device (D2D) communication manner is a manner in which user equipments (UE) directly communicate with each other. If the two UEs that perform D2D communication are separately marked as UE 1 and UE 2, when the UE 1 is in a coverage area of a base station, the UE 2 may connect to the base station by using the UE 1. In this case, the user equipment 1 may be referred to as relay UE, to be specific, UE that provides a relay service; and the UE 2 is referred to as far-end UE or remote UE.
In the D2D communication manner, the far-end UE and the relay UE trust each other. To be specific, the relay UE can learn of communication content between the far-end UE and the base station. In this way, if information on the relay UE is stolen, the communication content between the far-end UE and the base station may be leaked. In other words, data transmission security is relatively low.